/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frameImatge.java
 *
 * Created on 14-abr-2009, 17:44:26
 */

package brutot;

import java.awt.event.ComponentEvent;
import java.awt.event.WindowEvent;


/*import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
//import javax.swing.ImageIcon;
*/
/**
 *
 * @author Scar
 */
public class frameImatge extends javax.swing.JFrame {
    private  String Path;
    private Panel panel1;
    int altura;
    int amplaria;
  //   Image photo;
  //  Graphics g;
    
    

    public void componentResized(ComponentEvent e){

    }
    /** Creates new form frameImatge */
   public frameImatge() {
    
        initComponents();
      
     //   this.Path = Path;
       // System.out.println("lo que me llega por path"+Path);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * private void formComponentResized(java.awt.event.ComponentEvent evt) {
        // TODO add your handling code here
    }

    private void formWindowStateChanged(java.awt.event.WindowEvent evt) {

    } WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel1 = new brutot.Panel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                formComponentResized(evt);
            }
        });

        panel1.agafa_path_panel(Path);

        javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1);
        panel1.setLayout(panel1Layout);
        panel1Layout.setHorizontalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1584, Short.MAX_VALUE)
        );
        panel1Layout.setVerticalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1218, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
        // TODO add your handling code here:
        System.out.println("Amplaria:"+this.getWidth());
         System.out.println("Altura:"+this.getHeight());
    }//GEN-LAST:event_formComponentResized

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {

                new frameImatge().setVisible(true);
            }
        });
    }
     public int retornaAltura(){
        return panel1.retornaAltura();
    }
    public int retornaAmplaria(){
        return panel1.retornaAmplaria();
    }
    public void agafa_path(String path){
        this.Path=path;
        System.out.println("frameimage path: "+ path);
        panel1.agafa_path_panel(Path);


    }/*
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private brutot.Panel panel1;
    // End of variables declaration//GEN-END:variables
*/
}
